package com.ruoyi.gybj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gybj.mapper.MessageFieldMapper;
import com.ruoyi.gybj.domain.MessageField;
import com.ruoyi.gybj.service.IMessageFieldService;

/**
 * 消息字段Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class MessageFieldServiceImpl implements IMessageFieldService 
{
    @Autowired
    private MessageFieldMapper messageFieldMapper;

    /**
     * 查询消息字段
     * 
     * @param id 消息字段主键
     * @return 消息字段
     */
    @Override
    public MessageField selectMessageFieldById(Long id)
    {
        return messageFieldMapper.selectMessageFieldById(id);
    }

    /**
     * 查询消息字段列表
     * 
     * @param messageField 消息字段
     * @return 消息字段
     */
    @Override
    public List<MessageField> selectMessageFieldList(MessageField messageField)
    {
        return messageFieldMapper.selectMessageFieldList(messageField);
    }

    /**
     * 新增消息字段
     * 
     * @param messageField 消息字段
     * @return 结果
     */
    @Override
    public int insertMessageField(MessageField messageField)
    {
        messageField.setCreateTime(DateUtils.getNowDate());
        return messageFieldMapper.insertMessageField(messageField);
    }

    /**
     * 修改消息字段
     * 
     * @param messageField 消息字段
     * @return 结果
     */
    @Override
    public int updateMessageField(MessageField messageField)
    {
        return messageFieldMapper.updateMessageField(messageField);
    }

    /**
     * 批量删除消息字段
     * 
     * @param ids 需要删除的消息字段主键
     * @return 结果
     */
    @Override
    public int deleteMessageFieldByIds(Long[] ids)
    {
        return messageFieldMapper.deleteMessageFieldByIds(ids);
    }

    /**
     * 删除消息字段信息
     * 
     * @param id 消息字段主键
     * @return 结果
     */
    @Override
    public int deleteMessageFieldById(Long id)
    {
        return messageFieldMapper.deleteMessageFieldById(id);
    }
}
